package com.atwulidun.composite08;

public abstract class OrganizationComponent {
    // 名称
    private String name;
    // 描述
    private String des;

    public OrganizationComponent(String name, String des) {
        this.name = name;
        this.des = des;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    // 增加的方法，叶子结点不需要重写该方法，写成默认实现
    protected void add(OrganizationComponent organizationComponent) {

    }

    // 删除方法，叶子结点不需要重写该方法，写成默认实现
    protected void remove(OrganizationComponent organizationComponent) {

    }

    // 打印方法，所有结点都要重写该方法，写成抽象方法
    protected abstract void print();
}
